"""
主机名或IP地址：120.55.96.226
数据库名：testdatabase
端口：3306
数据库用户名：testuser
数据库密码：msjy1010

"""
import pymysql


def execute_sql(
        command,
        index=0,
        host="120.55.96.226",
        user="testuser",
        password="msjy1010",
        database="testdatabase"
):
    with pymysql.connect(host=host, user=user, password=password, database=database) as conn:
        with conn.cursor() as cursor:
            cursor.execute(command)
            res = cursor.fetchall()
            print(res)
            return res


sql = "select * form"
sql1 = "show tables;"
sql2 = "select * form"
res = execute_sql(sql1)
